<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>参数设置 / 门禁开放计划-新增门禁开放计划-新增节假日</title>
  <link rel="stylesheet" href="../../../css/layui.css" media="all">
  <link rel="stylesheet" type="text/css" href="../../../css/common-layer.css"/>
  <style>
  	.layui-form-item{margin-bottom: 10px;}
  	.layui-form-select dl{max-height: 187px;}
  	.layui-form-item .layui-input-inline{width: 460px !important;}
  </style>
</head>
<body style="background: #fff;overflow-x:hidden ;" class="innerBody">

<form class="layui-form layui-form-pane ml30" action="" id="formHtml" style="width: ;margin-top: 20px;" lay-filter="updForm">
	<div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">起止时间</label>
      <div class="layui-input-inline" style="width: 320px !important;">
        <input type="text" name="date" id="date1" placeholder="开始时间" autocomplete="off" class="layui-input">
      </div>
    </div>
  </div>
  <div class="layui-form-item layui-form-text" style="width: 450px;">
  	  <label class="layui-form-label label-120">备注</label>
  	  <div class="layui-input-block">
  		<textarea style="resize:none;height: 160px;" name="desc" placeholder="请输入备注" class="layui-textarea" ></textarea>
  	  </div>
  </div>
  <div class="layui-form-item  window-block-btn">
    <div class="layui-input-block">
    	<button type="button" class="layui-btn layui-btn-primary window-btn" id="canleBtn">取消</button>
      <button type="button" class="layui-btn window-btn" lay-submit="" lay-filter="confirmBtn">确定</button>
      
    </div>
 	</div>
</form>


</body>

<script src="../../../layui.all.js"></script>
<script src="../../../js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	 //主动加载jquery模块
	layui.use(['jquery', 'layer','laydate'], function(){
		var $ = layui.jquery //重点处
		,laydate = layui.laydate
		,layer = layui.layer;
		//得到父页面的id值
		var index = (window.parent.index_);
		console.log(index);
	  //起止时间
	  laydate.render({
	    elem: '#date1'
	    ,trigger: 'click'//自定义弹出框，采用click弹出
	  });
	 
		layui.use('form', function(){  
		 	var form = layui.form;
		 	//------确认-------
			form.on('submit(confirmBtn)', function (data) {
			    var obj = data.field;
			    console.log(obj);
			    //以下是ajax
			    
			    /*添加成功之后，关闭弹窗，*/
			    parent.layer.close(index);//关闭layer
			   
			});
			//取消
			$("body").on("click","#canleBtn",function(){
				parent.layer.close(index);//关闭layer
			})
			
		})	
	})
   
</script>
</html>